﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace TFSCommon
{
    using Settings;

    public partial class TFSOptions : Common.Forms.formDefaultSettings
    {
        private MySettingsManager sm = new MySettingsManager();
        private MySettingsControl sc = new MySettingsControl();

        public TFSOptions(string options)
            : base()
        {
            sm.Set(options);
            AddSettings(sm, sc);
        }

        protected override void btnAccept_Click(object sender, EventArgs e)
        {
            MyBugtracker mbt = new MyBugtracker(new MySettingsManager(this.Options));
            Validating v = new Validating(this.Options, sc);

            if (v.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {
                base.btnAccept_Click(sender, e);
            }
            else
            {
                this.DialogResult = System.Windows.Forms.DialogResult.None;
            }
        }
    }
}
